<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        body {
            background: url(images/1.jpg) no-repeat center top;
        }
        
        img {
            width: 100px;
        }
        
        li {
            list-style: none;
            float: left;
        }
        
        ul {
            width: 400px;
            margin: 0 auto;
        }
    </style>
</head>

<body>
    <ul>
        <li><img src="images/1.jpg" alt=""></li>
        <li><img src="images/2.jpg" alt=""></li>
        <li><img src="images/3.jpg" alt=""></li>
        <li><img src="images/4.jpg" alt=""></li>
    </ul>
    <script>
        var img = document.querySelector('ul').querySelectorAll('img');
        for (var i = 0; i < img.length; i++) {
            img[i].addEventListener('click', function() {
                // console.log(this.src);
                // 'url(' + this.src + ')';
                // document.body.style.backgroundImage = 'url( ' + this.src + ')';
                // document.body.style.backgroundImage = `url()`
                document.body.style.backgroundImage = `url(${this.src})`

            });
        }
    </script>
</body>

</html>